# Contributor: <xmingske@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-gunicorn
_pkgname=gunicorn
pkgver=20.0.4
pkgrel=0
pkgdesc="WSGI HTTP Server for UNIX"
url="https://gunicorn.org/"
arch="noarch"
license="MIT"
depends="py3-setuptools"
checkdepends="py3-pytest py3-pytest-cov py3-aiohttp"
source="$_pkgname-$pkgver.tar.gz::https://github.com/benoitc/gunicorn/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

replaces=py-gunicorn # Backwards compatibility
provides=py-gunicorn=$pkgver-r$pkgrel # Backwards compatibility

prepare() {
	default_prepare
	# use installed checkdepends instead of fetching from pypi
	sed -i \
		-e 's/==.*//' \
		-e '/cover/d' \
		requirements_test.txt
}

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="$PWD" pytest
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="5a82a448e07ede9e987b14c9ae4abfda29ed80d4220d640f68dab6fb59bb4bdab3d5fc3f0689ddc36102d88a10dbd244ee90e62647acea259429e8a79f370ea4  gunicorn-20.0.4.tar.gz"
